/**
 * 
 */
package com.et114.modules.content.dao;

import java.util.List;

import com.et114.components.simpletable.DataList;
import com.et114.components.simpletable.dao.SimpleTableDAOImpl;
import com.et114.modules.content.vo.CommonContent;
import com.et114.modules.content.vo.CommonType;

/*
 * @author guanhw
 */
public class CommonContentDao extends SimpleTableDAOImpl {
	
	public DataList getCommonContents( CommonContent cc ) throws Exception {
		return queryListDataList ( cc , "getCommonContents" ) ; 
	}
	
	public CommonContent  getCommonContentById ( Long id ) throws Exception {
		return ( CommonContent ) load( id , "getCommonContentById" ) ;
	}
	
	public DataList getCommonContentsCacheModel( CommonType cc ) throws Exception {
		return queryListDataList ( cc , "getCommonContentsCacheModel" ) ; 
	}

	@ SuppressWarnings ( "unchecked" )
	public List< CommonContent > getCommonContentsNpageCacheModel( CommonType cc ) throws Exception {
		return queryList ( cc , "getCommonContentsCacheModel" ) ; 
	}
	
	
	public CommonContent  getCommonContentByIdCacheModel ( Long id ) throws Exception {
		return ( CommonContent ) load( id , "getCommonContentByIdCacheModel" ) ;
	}
	
	
	public Long saveCommonContent( CommonContent cc ) throws Exception {
		return ( Long  ) insert( cc , "insertCommonContent" ) ; 
	}
	
	public void updateCommonContent( CommonContent cc ) throws Exception {
		update( cc , "updateCommonContent" )  ; 
	}
	
	
	public void removeCommonContent( Long id ) throws Exception {
		delete( id , "removeCommonContent" ) ; 
	}
	
	public void removeCommonContentByTypeId( Long typeId ) throws Exception {
		delete( typeId , "removeCommonContentByTypeId" ) ; 
	}
}
